package pro.ticktock.base.tree.impl;

import pro.ticktock.base.tree.api.Entry;

/**
 * @author lambert
 * @created 18-9-30
 */
public interface TypedHashEntryTreeNode<T extends TypedHashEntryTreeNode<T, K, V>, K, V>
        extends TypedEntryTreeNode<T, K, V> {

  public T getChildBy(K key);

  public Entry<K, V> getChildValueBy(K key);

  public V getChildEntryValueBy(K key);

  default public boolean removeChildBy(K key) {
    T child = getChildBy(key);
    if (child == null) return false;
    else return removeChild(child);
  }

  public void putChild(T child);

  public void putChild(int idx, T child);

}
